sched: fix dom0less boot with the null scheduler
authorDario Faggioli <dfaggioli@suse.com>
Tue, 12 Nov 2019 17:03:49 +0000 (17:03 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 12 Nov 2019 17:03:49 +0000 (17:03 +0000)
commitd13dfb02aafaba376b24ff0dc64e19ba1c360803
treecfd146acf03004e7adfa3bf0af775c8c4293ed95
parent8f1d6c049c0439d8c5b175a0f8369cfde57ba08c
sched: fix dom0less boot with the null scheduler

In a dom0less configuration, if the null scheduler is used, the system
may fail to boot, because the loop in null_unit_wake() never exits.

Bisection showed that this behavior occurs since commit d545f1d6 ("xen:
sched: deal with vCPUs being or becoming online or offline") but the
real problem is that, in this case, pick_res() always return the same
CPU.

Fix this by only deal with the simple case, i.e., the vCPU that is
coming online can be assigned to a sched. resource right away, in
null_unit_wake().

If it can't, just add it to the waitqueue, and we will deal with it in
null_schedule(), being careful about not racing with vcpu_wake().

Reported-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_null.c